@extends('Admin.layout.layout')
@section('content')

<div class="row">
    <div class="col-lg-12">
        <h1 class="page-header">分类修改</h1>
    </div>
    <!-- /.col-lg-12 -->
</div>
@if (count($errors) > 0 )
    <div class="alert alert-danger">
    @foreach ($errors->all() as $error)
        <li>{{ $error }}</li>
    @endforeach
    </div>
@endif    
@if(session('error'))
<div class="alert alert-danger">
    <li>{{session('error')}}</li>
</div>
@endif
<center>
<div style="width:600px">
<form action="{{url('/admin/cate/update')}}" method="post">
<div class="form-group">
    <label>分类选择</label>
    <select name="pid" class="form-control">
        <option value= "0" >顶级分类</option>
        @foreach($cate as $k=>$v)
        @if($data->pid == $v->id)
        <option value= "{{$v->id}}" selected>{{$v->name}}</option>
        @else if
        <option value= "{{$v->id}}">{{$v->name}}</option>
        @endif
        @endforeach
    </select>
</div>
<div class="form-group">
    <label>分类名</label>
    <input name="name" class="form-control" placeholder="分类名称" value="{{$data->name}}">
</div>
<input type="hidden" name="id" value="{{$data->id}}">
{{ csrf_field() }}
<button class="btn btn-primary btn-lg btn-block">提交</button>
</form>
</div>
</center>
@endsection